#include <iostream>
#include <string>
#include <memory>

using namespace std;

class Person
{
private:
    string m_name;

public:
    Person() {}
    Person(const char *s)
    {
        m_name = s;
        cout << s << "\tmake" << endl;
    };

    Person(const Person &p)
    {
        this->m_name = p.m_name;
        cout << m_name << "\tcopy_make" << endl;
    }

    Person& operator=(const Person &p)
    {
        this->m_name = p.m_name;
        cout << m_name << "\t=_make" << endl;
        return *this;
    }
};

Person &test(const Person &p)
{
    cout << "---------------" << endl;

    static Person pArr[2]{Person("zhao"), Person("liu")};

    cout << "---------------" << endl;

    // return pArr[1];

    Person *pPerson = new Person[2]{Person("nuo"), Person("yan")};

    // std::unique_ptr<Person> ppp(new Person[2]{Person("nuo1"), Person("yan1")});
    return pPerson[0];
}

int main(int argc, char **argv)
{
    cout << "---------------" << endl;
    // Person p1("sun");
    Person p2("nuo");
    Person p4 = p2;
    p4 = p2;
    Person p3(test(p2));
    return 0;
}